package com.example.demo.msg.socketio;/**
 * Created by kete on 2017-12-19.
 */

import com.corundumstudio.socketio.SocketIOServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

/**
 * 作者：kete
 * 创建时间：2017-12-19 14:57
 * 功能描述：
 * 版本：
 */
@Component
@ConditionalOnProperty(prefix = "guns", name = "web-socket-open", havingValue = "true")
public class SocketServerRunner implements CommandLineRunner {

    @Autowired
    private SocketIOServer socketIOServer;


    @Override
    public void run(String... strings) throws Exception {

        socketIOServer.start();
    }
}
